package org.example.main;
import org.example.main.R;

import android.app.Activity;
import android.app.AlertDialog;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout.LayoutParams;

public class Bar2 extends Activity {
    private static final int PROGRESS = 0x1;

    private ProgressBar mProgress;
    private int mProgressStatus = 0;

    private Handler mHandler = new Handler();

    protected void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        setContentView(R.layout.bar);

        mProgress = (ProgressBar) findViewById(R.id.progress_bar);

        // Start lengthy operation in a background thread
        new Thread(new Runnable() {
            public void run() {
            	
                while (mProgressStatus < 100) {
                    
                	mProgressStatus++;
                	
                    // Update the progress bar
                    mHandler.post(new Runnable() {
                        public void run() {
                        	
                            mProgress.setProgress(mProgressStatus);
                            
                        }
                    });
                }
              Thread t=new Thread();
              try {t.sleep(8000);} catch (InterruptedException e) {e.printStackTrace();} 
              System.out.println("*****************************************stop");
              finish();
            
            }
        }).start();
    }
}
